<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="text" v-model="info">
    <input type="button" value="按钮1" @click="f()">
    <input type="button" value="按钮2" v-on:click="f1()">
</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el: "body>div",
        data: {
            info:""
        },
        methods:{
            f(){
                alert(v.info)
            },
            f1(){
                alert("按钮2点击了！")
            }
        }
    })
</script>
</body>
</html>